﻿using System;
using System.Collections.Generic;
using System.Text;
using Dzzzr.DataLayer;
using Dzzzr.Utils;

namespace Dzzzr
{
	public class PersonController
	{
		public static List<PersonInfo> GetPersonList(int teamID)
		{
			return CBO.FillCollection<PersonInfo, List<PersonInfo>>(typeof(PersonInfo), PersonProvider.GetPersonList(teamID));
			
		}
		public static PersonInfo GetPerson(int personID)
		{
			return CBO.FillObject<PersonInfo>(typeof(PersonInfo), PersonProvider.GetPersonList(personID));
		}
		public static void InsertPerson(PersonInfo person)
		{
			PersonProvider.InsertPerson(person.ID, person.Name, person.Description, 
				person.MaxSendingPause, person.FullName, person.BirthDate, person.TeamPhone, person.OtherPhones, person.ICQ,
				person.Skype, person.OtherIMs, person.Radio, person.Tracker, person.OtherDevices);
		}
		public static void UpdatePerson(PersonInfo person)
		{
			PersonProvider.UpdatePerson(person.ID, person.Name, person.Description, 
				person.MaxSendingPause, person.FullName, person.BirthDate, person.TeamPhone, person.OtherPhones, person.ICQ,
				person.Skype, person.OtherIMs, person.Radio, person.Tracker, person.OtherDevices);
		}
		public static void DeletePerson(PersonInfo person)
		{
			PersonProvider.DeletePerson(person.ID);
		}


	}
}
